Anyone have luck printing the current DXL under execution? Played with XFLAGS_ and SrcPrint_, but it triggers diagnostic logs.
llandale - Wed Feb 17 12:00:31 EST 2010 |
Re: Print Source Code |
Re: Print Source Code doors36677 - Wed Feb 17 12:31:50 EST 2010 I think DOORS uses Yacc to parse the DXL code before execution and will convert it to some kind of "microcode", which is then executed. I played with the _srcprint and XFLAGS options once too and I only got print-outs of the dxl "microcode" but but never the source code. I don't think that you can get the sourcecode from DXL unless you look at the right memory location, but this one is different for every doors executable. Regards, Mathias |
Re: Print Source Code Mathias Mamsch - Wed Feb 17 13:10:33 EST 2010 |
Re: Print Source Code doors36677 - Wed Feb 17 12:31:50 EST 2010 Have no clue about using Assembly within a DXL script. Anyway, you have some code that resembles this ??:
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
|
Re: Print Source Code llandale - Wed Feb 17 16:40:36 EST 2010 Have no clue about using Assembly within a DXL script. Anyway, you have some code that resembles this ??:
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
But as far as I know there is no undocumented dxl command to grab or print text from the dxl input window. However, finding the window and grabbing the text is relative easy to do with system calls. Grabbing the window is easy -- but pushing the print button by code is much more complex. |
Re: Print Source Code llandale - Wed Feb 17 16:40:36 EST 2010 Have no clue about using Assembly within a DXL script. Anyway, you have some code that resembles this ??:
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
void FindFatalError()
{ string CurrentCode = GetCurrentCode(MagicDxlSetting3)
print CurrentCode "\n"
}
FindFatalError()
2. Use the function "dxlHere()" to print the line numbers, which if you were ambitious, you could automagically transform into the line of code with some other app. Of course, if you want the lines of code in something more useful than the DXL Interaction window, use IPC or Streams or Files or whatever. |
Re: Print Source Code doors36677 - Wed Feb 17 13:21:03 EST 2010 And if you have a way to "embed" assembly code into DXL and execute it in the DOORS process space, that really would bring some nice extensibility to DOORS. The only way I know of is to put the assembly code into a COM server and call it there. Do you know a way without a COM server? Regards, Mathias |
Re: Print Source Code
Ping.
void RunBodyOfTrigger(Trigger tCurr)
{ Object obj = object(tCurr)
proceed with processing the trigger
} // end BodyOfTrigger()
void DeployTrigger()
{ string DxlCode = GetTheCurrentDxlCode() // *********
string ErrMess = checkDxl(DxlCode)
if (!null ErrMess) //
then display errmess
else
{ offer to delete triger, if it exists
offer to deploy trigger
}
}
// ********* MAIN *********
Trigger tCurr = current
if (!null tCurr) //-
then RunBodyOfTrigger(tCurr) // Code running as Trigger
else DeployTrigger() // code running on demand
|
Re: Print Source Code llandale - Sun Jun 27 20:56:32 EDT 2010
Ping.
void RunBodyOfTrigger(Trigger tCurr)
{ Object obj = object(tCurr)
proceed with processing the trigger
} // end BodyOfTrigger()
void DeployTrigger()
{ string DxlCode = GetTheCurrentDxlCode() // *********
string ErrMess = checkDxl(DxlCode)
if (!null ErrMess) //
then display errmess
else
{ offer to delete triger, if it exists
offer to deploy trigger
}
}
// ********* MAIN *********
Trigger tCurr = current
if (!null tCurr) //-
then RunBodyOfTrigger(tCurr) // Code running as Trigger
else DeployTrigger() // code running on demand
But failing to get a copy of the code itself, perhaps I can insert a clever fileName() function allowing the user to browse for some file with the same base name as this script; and have the code remember which one was used last time. This would, I suppose, be reasonably close to self-installing trigger code, allowing me to have a single file for the trigger rather than two.
|